<a href="javascript:;" class="btn btn-primary btn-refresh " style="display:none;" onclick="load()" title="刷新"><i class="fa fa-refresh"></i> </a>
<style>
.table-bordered > thead > tr > th, .table-bordered > thead > tr > td {

    white-space: nowrap;
    text-align: center;
    vertical-align: middle!important;
}
.table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
     white-space: nowrap;
	text-align: center;
    vertical-align: middle!important;
	    border: 1px solid #ddd;
}
.fixed-table-body{

}
</style>
<table  class="table table-striped table-bordered table-hover" width="100%">
	   <thead>
			<tr>
				 <th><?php echo __('Books.Number');?></th>
				 <th><?php echo __('Books.data');?></th>
				 <th><?php echo __('Books.Cost_id');?></th>
				 <th><?php echo __('Books.Pay_type');?></th>
				 <th><?php echo __('Books.Price');?></th>
				 <th><?php echo __('Books.Abstract');?></th>
				 <th><?php echo __('Books.Sign');?></th>
			<!-- 	 <th><?php echo __('Books.Status');?></th> -->
				 <th><?php echo __('Desc');?></th>
			     <th><?php echo __('Operate');?></th>
			</tr>
	   </thead>
	   <tbody>

	   <?php if(!empty($Books_view['Books_view'])){ ?>
			<?php foreach($Books_view['Books_view'] as $k=>$v){?>

					<tr>
						<td><?php echo $v['number'];?></td>
						<td><?php echo date('Y-m-d H:i:s',$v['createtime']);?></td>
						<td><?php echo !empty($v['cost_id']) && $v['pay_type'] == 2 ? TableField('Cost','name',$v['cost_id']) : '-';?></td>
						<td><?php echo __('Books.Pay_type '.$v['pay_type'].'');?></td>
						<td><?php echo $v['price'];?></td>
						<td><?php echo $v['abstract'];?></td>
						<td><?php echo $v['sign'];?></td>
					<!-- 	<td><?php echo __('Books.Status '.$v['status'].'');?></td> -->
						<td><?php echo $v['desc'];?></td>
						<td >
							<?php if(isset($WeekModel['Books']['edit'])){ ?>
								<a href="javascript:;" class="btn btn-primary btn-xs" onclick="edit(<?php echo $v['id'];?>,'Books')" title="修改"><i class="fa fa-edit"></i>&nbsp;修改</a>
							<?php }?>
							<?php if(isset($WeekModel['Books']['delete'])){ ?>
								<a href="javascript:;" onclick="del(<?php echo $v['id'];?>,'Books')" title="删除" class="btn btn-danger btn-xs"><i class="fa fa-remove"></i>&nbsp;删除</a>
							<?php }?>
						</td>
					</tr>
			 <?php }?>
		 <?php }?>
	   </tbody>

</table>
<script type="text/javascript">
	var active = '{$active}';

	function edit(id,type){
		var url_layer = 'finance/extract/week/public_edit/id/'+id+'/type/'+type;
		Fast.api.open(url_layer,'修改记录');
	}
	function del(id,type){
		var url_layer = 'finance/extract/week/public_delete/id/'+id+'/type/'+type;
		 Layer.confirm(
			__('Are you sure you want to delete this item?'),
			{icon: 3, title: __('Warning'), shadeClose: true},
			function (index) {
				Fast.api.ajax({
					url: url_layer,
				});
				Layer.close(index);
				setTimeout(function() {
					load();
				},2000);
			}
		);

	}
	//加载
	function load(){
		var url = window.location.href;
		window.location.href = url;
	}


</script>